﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MBSPL.UserControls.CinemaUserControl
{
    public partial class AddCinemaUserControl : System.Web.UI.UserControl
    {
        #region transfer

        MBSBLC.BLC cinemablc=new MBSBLC.BLC();
        private bool actionresult;


        public delegate void CinemaAddHandler();

        public event CinemaAddHandler CinemaAddComplete;
        public event CinemaAddHandler CinemaAddFailed;

        public bool Actionresult
        {
            get { return actionresult; }
            set { actionresult = value; }
        }
    
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                cinemablc = new MBSBLC.BLC();
            }  
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
           actionresult=cinemablc.AddCinema(txtCinemaName.Text,txtLocation.Text,txtNumberOfScreens.Text.ToString());
           if (actionresult) { CinemaAddComplete(); }
           else
           {
               CinemaAddFailed();
           }
        
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            txtCinemaName.Text="";
            txtLocation.Text = "";
            txtNumberOfScreens.Text = "";
        }




    }
        #endregion
}